import requests

def get_route(start_location, end_location, ak):
    url = f"http://api.map.baidu.com/direction/v2/transit?origin={start_location}&destination={end_location}&ak={ak}"
    response = requests.get(url)
    return response.json()

# 示例调用
start = "34.105781,109.343251"  # 蓝关古道的位置
end = "34.123456,109.123456"
ak = "SGEyhSS0Fir6EBEoarGXd8UubB75a1YI"
route = get_route(start, end, ak)
print(route)